import java.util.Scanner;

/*
   实例:找奇数
 */
public class MothodDemo03 {
    public static void main(String[] args) {
        int num1 = 0;
        int num2 = 0;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个数:");
        int num01 = sc.nextInt();
        System.out.println("请输入第二个数:");
        int num02 = sc.nextInt();
        if (num01 < num02) {
            num1 = num01;
            num2 = num02;
        } else {
            num1 = num02;
            num2 = num01;
        }
        print(num1, num2);
    }

    public static void print(int num1, int num2) {
        System.out.println(num1+"到"+num2+"之间奇数有:");
        for (int i = num1; i <= num2; i++) {
            if (i % 2 == 1) {
                System.out.println(i);
            }
        }
    }
}
